<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../../vue.js"></script>
  </head>

  <body>
    <div id="app">
    </div>

    <script>
      Vue.config.productionTip = false;
      // 1.使用Vue.extend得到了一个组件实例
      const MyCount = Vue.extend({
        
        name: "Count",
        data() {
          return {
            count: 0,
          };
        },
        template: `
        <div>
          <h1>我是丁阳阳</h1>
          <br/>
          <button @click="count++">累加</button>
      </div>
        `,
      
      })
      console.log(MyCount);
      console.log(new MyCount);
      //实例化Vue
      const vm = new Vue({
        el: "#app",
        data() {
          return {
            count: 1,
          };
        },
        components: {
          //2.将这个组件注册
          MyCount: MyCount,
        },
        // 3.使用地方1
        template: `
          <div>
            <MyCount/>  
          </div>
        `,
      });

      
    </script>
  </body>
</html>
